package com.lagou.task16;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class ExceptionThrowsTest {
    public static void show() throws IOException {
        FileInputStream file = new FileInputStream("/Users/mac/Desktop/output1.json");
        System.out.println("异常抛出后代码继续执行了");
        file.close();
    }

    //不建议在main方法中抛出异常
    public static void main(String[] args) {
        try {
            show();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
